package com.sgb.kjwl.view.ui.adapter.search;

import android.annotation.SuppressLint;
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.view.View;
import android.widget.PopupWindow;
import android.widget.TextView;

import com.sgb.kjwl.BR;
import com.sgb.kjwl.R;
import com.sgb.kjwl.databinding.MatterChooseBinding;
import com.sgb.kjwl.model.entity.user.MaterChooseEntity;
import com.sgb.kjwl.view.widget.transport.MatterChooseWindow;
import com.swgk.core.customview.ScreenTextView;
import com.swgk.core.recyclerview.adapter.BaseRecycleAdapter;
import com.swgk.core.recyclerview.adapter.ItemViewHolder;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class RecommendMatterChooseAdapter extends BaseRecycleAdapter<MaterChooseEntity> {

    private MatterChoose mMatterChoose;

    public RecommendMatterChooseAdapter(Context context, List<MaterChooseEntity> datas) {
        super(context, R.layout.matter_choose, datas);
    }

    public void setmMatterChoose(MatterChoose mMatterChoose) {
        this.mMatterChoose = mMatterChoose;
    }

    @SuppressLint("SetTextI18n")
    @Override
    public void convert(ItemViewHolder holder, final MaterChooseEntity entity) {
        holder.setBinding(BR.name, entity);

        ScreenTextView screenTextView = holder.getItem().findViewById(R.id.tv_fragment_goods_main_goods_list_select3);
        screenTextView.setOnClickListener(v -> {
            mMatterChoose.setPop(entity,screenTextView);
        });
    }

    public interface MatterChoose{
        void setPop(MaterChooseEntity entity, ScreenTextView select);
    }
}
